clear all
cd ..

use "Data/Processed Data/ACSdata_env.dta" 
label variable env_ben_PC   "Env benefits per capita" 
label variable Median_HH_10k   "Income (10k)" 
label variable Urban_Indicator   "Urban" 
label variable share_pop_black   "Share Black" 
label variable share_pop_latino   "Share Hisp/Latinx"
label variable share_pop_asian   "Share Asian"
label variable share_pop_whitealone   "Share White"

*Ouput summary statistics by region.
eststo clear
*South
estpost sum env_ben_PC Median_HH_10k share_pop_black share_pop_latino share_pop_asian share_pop_whitealone Urban_Indicator [aweight=Number_POP_x] if RegionName=="South"
esttab using "tables/sum_stats_south.tex", replace label nonumber noobs nomtitle booktabs cell((mean(fmt(%9.3f) label(Mean)) sd(fmt(%9.3f) label(SD)) min(fmt(%9.3f) label(Min)) max(fmt(%9.3f) label(Max)))) addnotes("Block groups are weighted by population. Environmental benefits are \textit{received}.") ///
alignment(D{.}{.}{-1})

eststo clear
*West
estpost sum env_ben_PC Median_HH_10k share_pop_black share_pop_latino share_pop_asian share_pop_whitealone Urban_Indicator [aweight=Number_POP_x] if RegionName=="West"
esttab using "tables/sum_stats_west.tex", replace label nonumber noobs nomtitle booktabs cell((mean(fmt(%9.3f) label(Mean)) sd(fmt(%9.3f) label(SD)) min(fmt(%9.3f) label(Min)) max(fmt(%9.3f) label(Max)))) addnotes("Block groups are weighted by population. Environmental benefits are \textit{received}.") ///
alignment(D{.}{.}{-1})

eststo clear
*Midwest
estpost sum env_ben_PC Median_HH_10k share_pop_black share_pop_latino share_pop_asian share_pop_whitealone Urban_Indicator [aweight=Number_POP_x] if RegionName=="Midwest"
esttab using "tables/sum_stats_midwest.tex", replace label nonumber noobs nomtitle booktabs cell((mean(fmt(%9.3f) label(Mean)) sd(fmt(%9.3f) label(SD)) min(fmt(%9.3f) label(Min)) max(fmt(%9.3f) label(Max)))) addnotes("Block groups are weighted by population. Environmental benefits are \textit{received}.") ///
alignment(D{.}{.}{-1})

eststo clear
*Northeast
estpost sum env_ben_PC Median_HH_10k share_pop_black share_pop_latino share_pop_asian share_pop_whitealone Urban_Indicator [aweight=Number_POP_x] if RegionName=="Northeast"
esttab using "tables/sum_stats_northeast.tex", replace label nonumber noobs nomtitle booktabs cell((mean(fmt(%9.3f) label(Mean)) sd(fmt(%9.3f) label(SD)) min(fmt(%9.3f) label(Min)) max(fmt(%9.3f) label(Max)))) addnotes("Block groups are weighted by population. Environmental benefits are \textit{received}.") ///
alignment(D{.}{.}{-1})

